package com.wang.demo.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :  DongZheng Wang
 * @PROJECT_NAME: secrityspring
 * @date :  2023-01-03 16:15
 **/
@RestController
@RequestMapping("user")
public class UserControlle {
    @GetMapping("delete")
    @PreAuthorize(value = "hasAuthority('user:delete')")
    public String delete(){
        return "删除操作";
    }
    @GetMapping("insert")
    @PreAuthorize(value = "hasAuthority('user:insert')")
    public String insert(){
        return "添加操作";
    }
    @GetMapping("update")
    @PreAuthorize(value = "hasAuthority('user:update')")
    public String update(){
        return "修改操作";
    }
    @GetMapping("query")
    @PreAuthorize(value = "hasAuthority('user:query')")
    public String query(){
        return "查询操作";
    }
    @GetMapping("export")
    @PreAuthorize(value = "hasAuthority('user:export')")
    public String export(){
        return "导出操作";
    }
}
